/*
	author: TangQiao , Wind @ Beijing Normal University

	problem name: France '98
	
	source :  BNU Online Judge
	
	problem type: 模拟题
	
	problem description: 给出16个队每个队的胜率. 
	
	problem solution: 其实可以用一个FOR写完的,可是我思路老是不清楚,于是开始一点就分开写了,后来清楚一些后
	又用FOR 来写了后面一些,反正整个程序乱七八糟的.
	
	date : 2005.7.16 北师大个人练习赛
	
*/
#include <stdio.h>
#include <string.h>
#include <math.h>


double rate[17][17];
char name[17][50];
double count[2][17];


const int n=16;

void init()
{
	int i,j;
	for (i=1;i<=n;i++)
		scanf("%s", name[i]);
	for (i=1;i<=n;i++)
		for (j=1;j<=n;j++)
		{
			scanf("%lf", &rate[i][j]);
			rate[i][j]/=100;
		}
}

main()
{
	int a,b;
	double tot;
	int one=0,two=1;
	int i,j,k;
	init();


	for (i=1;i<=n;i+=2)
	{
		count[0][i]=rate[i][i+1];
		count[0][i+1]=rate[i+1][i];		
	}
	
	for (i=1;i<=n;i+=4)
	{
		j=i/4*4+3;
		count[two][i]=count[one][i]*(count[one][j]*rate[i][j]+count[one][j+1]*rate[i][j+1]);
		count[two][i+1]=count[one][i+1]*(count[one][j]*rate[i+1][j]+count[one][j+1]*rate[i+1][j+1]);
	}
	for (i=3;i<=n;i+=4)
	{
		j=i/4*4+1;
		count[two][i]=count[one][i]*(count[one][j]*rate[i][j]+count[one][j+1]*rate[i][j+1]);
		count[two][i+1]=count[one][i+1]*(count[one][j]*rate[i+1][j]+count[one][j+1]*rate[i+1][j+1]);
	}
	one=one^1;
	two=two^1;
	for (i=1;i<=n;i+=8)
	{
		j=i/8*8+5;
		count[two][i]=count[one][i]*(count[one][j]*rate[i][j]+
			                         count[one][j+1]*rate[i][j+1]+
									 count[one][j+2]*rate[i][j+2]+
									 count[one][j+3]*rate[i][j+3]);
		a=i+1;
		count[two][a]=count[one][a]*(count[one][j]*rate[a][j]+
			count[one][j+1]*rate[a][j+1]+
			count[one][j+2]*rate[a][j+2]+
			count[one][j+3]*rate[a][j+3]);
		a=i+2;
		count[two][a]=count[one][a]*(count[one][j]*rate[a][j]+
			count[one][j+1]*rate[a][j+1]+
			count[one][j+2]*rate[a][j+2]+
			count[one][j+3]*rate[a][j+3]);
		a=i+3;
		count[two][a]=count[one][a]*(count[one][j]*rate[a][j]+
			count[one][j+1]*rate[a][j+1]+
			count[one][j+2]*rate[a][j+2]+
			count[one][j+3]*rate[a][j+3]);
	}
	for (i=5;i<=n;i+=8)
	{
		j=i/8*8+1;
		for (a=i;a<i+4;a++)		
		{
			for (k=j,tot=0;k<j+4;k++)
				tot+=count[one][k]*rate[a][k];
			count[two][a]=count[one][a]*tot;
		}
	}
	one=one^1;
	two=two^1;
	for (i=1;i<=n;i+=16)
	{
		j=9;
		for (a=1;a<=8;a++)
		{
			for (k=j,tot=0;k<j+8;k++)
				tot+=count[one][k]*rate[a][k];
			count[two][a]=count[one][a]*tot;
		}
	}
	for (i=1;i<=n;i+=16)
	{
		j=1;
		for (a=9;a<=16;a++)
		{
			for (k=j,tot=0;k<j+8;k++)
				tot+=count[one][k]*rate[a][k];
			count[two][a]=count[one][a]*tot;
		}
	}
	for (i=1;i<=n;i++)
	{
		printf("%s",name[i]);
		for (j=strlen(name[i]);j<=10;j++) printf(" ");
		printf("p=%.2lf%%\n",count[two][i]*100);
	}

	
	


	return 0;
}